#phase-diagram

import numpy as np
import pylab as pl
from pylab import *
import matplotlib.pyplot as pyplot

data11 = np.loadtxt('fig3a.dat')

data21 = np.loadtxt('fig3b_MI_DW.dat')
data22 = np.loadtxt('fig3b_DS.dat')
data23 = np.loadtxt('fig3b_SS.dat')
#
data31 = np.loadtxt('fig3c_MI_DW.dat')
data32 = np.loadtxt('fig3c_DS.dat')
data33 = np.loadtxt('fig3c_SS.dat')

fig1, axes = plt.subplots(nrows=3, ncols=1, figsize=(10,18))
pl.subplots_adjust(left=0.115, bottom=0.05, right=0.967, top=0.986, 
                   wspace=0.2, hspace=0.033)

#----------------------------subfigure 1---------------------------
plt.subplot(3,1,1)
rc('axes', linewidth=1)

pl.xlim(0, 0.09)
pl.ylim(0, 1.8)
pl.xticks([0,0.02,0.04,0.06,0.08],['','','','', ''], fontsize = 26)
pl.yticks([0,0.5,1,1.5],['0.0','0.5','1.0','1.5'], fontsize = 26)

plt.text(0.02, 1.2, r'MI', color='black', fontsize = 26)
plt.text(0.02, 0.40, r'CDW', color='black', fontsize = 26)
plt.text(0.07, 0.47,r'SS', color='black', fontsize = 26)
plt.text(0.06, 1, r'SF', color='black', fontsize = 26)
plt.text(0.08, 1.69, r'(a)', color='black', fontsize = 26)


ax = gca()

pl.plot(data11[:,0], data11[:,2], 'm-',linewidth=3)
pl.plot(data11[:,1], data11[:,2], 'b-',linewidth=3)

#----------------------------subfigure 2---------------------------
plt.subplot(3,1,2)
rc('axes', linewidth=1)

pl.xlim(0, 0.09)
pl.ylim(0, 1.8)
pl.xticks([0,0.02,0.04,0.06,0.08],['','','','', ''], fontsize = 26)
pl.yticks([0,0.5,1,1.5],['0.0','0.5','1.0','1.5'], fontsize = 26)
pl.ylabel(r'$\mu/U$', fontsize=26, weight='bold')

plt.text(0.02, 1.2, r'MI', color='black', fontsize = 26)
plt.text(0.02, 0.40, r'CDW', color='black', fontsize = 26) 
plt.text(0.07, 0.47,r'SS', color='black', fontsize = 26) 
plt.text(0.06, 1, r'SF', color='black', fontsize = 26)  
plt.text(0.083, 0.03, r'DS', color='black', fontsize = 26)
plt.text(0.08, 1.69, r'(b)', color='black', fontsize = 26)

plt.annotate('', xy=(0.083, 0.0685215), xytext=(0.071, 0.270867),
            arrowprops=dict(facecolor='red', edgecolor='black', arrowstyle='->', lw=3))



ax = gca()

pl.plot(data21[:,0], data21[:,1], 'm-',linewidth=3)
pl.plot(data22[:,0], data22[:,1], 'g-',linewidth=3)
pl.plot(data23[:,0], data23[:,1], 'b-',linewidth=3)


#----------------------------subfigure 3---------------------------
plt.subplot(3,1,3)
rc('axes', linewidth=1)

pl.xlim(0, 0.09)
pl.ylim(0, 1.8)
pl.xticks([0,0.02,0.04,0.06,0.08],['0.0','0.02','0.04','0.06', '0.08'], fontsize = 26)
pl.yticks([0,0.5,1,1.5],['0.0','0.5','1.0','1.5'], fontsize = 26)
pl.xlabel(r'$J/U$', fontsize=26, weight='bold')

plt.text(0.02, 1.2, r'MI', color='black', fontsize = 26)
plt.text(0.02, 0.40, r'CDW', color='black', fontsize = 26) 
plt.text(0.07, 0.47,r'SS', color='black', fontsize = 26) 
plt.text(0.06, 1, r'SF', color='black', fontsize = 26)  
plt.text(0.083, 0.05, r'DS', color='black', fontsize = 26)
plt.text(0.08, 1.69, r'(c)', color='black', fontsize = 26)

plt.annotate('', xy=(0.083, 0.089), xytext=(0.0688, 0.29),
            arrowprops=dict(facecolor='red', edgecolor='black', arrowstyle='->', lw=3))


ax = gca()

pl.plot(data31[:,0], data31[:,1], 'm-',linewidth=3)
pl.plot(data32[:,0], data32[:,1], 'g-',linewidth=3)
pl.plot(data33[:,0], data33[:,1], 'b-',linewidth=3)


fig1.savefig('phase-v1-d.pdf')
pl.show()
